<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FDButtonTest Test</title>
<!-- css -->
<link id="fd_theme" href="../../styles/theme/aristo/theme.css" rel="stylesheet" type="text/css" />
<link href="../../styles/primeui-1.1-min.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body{font-size: 12px;background-color: white;}
</style>
<!-- lib -->
<script type="text/javascript" src="../../src/FDLib/FDLib.js"></script>
<script type="text/javascript" src="../../src/JsMap.js"></script>
<!-- app js -->
<script type="text/javascript" src="../theme.js"></script>
</head>
<body>
<div id="btn1"></div>
<div id="btn2"></div>
<div id="btn3"></div>
<div id="btn4"></div>
<div id="btn5"></div>
<input type="button" onclick="setOnclickEvent()" value="setOnclickEvent"/>
<input type="button" onclick="setText()" value="setText"/>
<button onclick="disable()">disable</button>
<button onclick="enable()">enable</button>
<button onclick="hide()">hide</button>
<button onclick="show()">show</button>

<script type="text/javascript">
FDLib.setDir('../../src/');
var btn1;

FDLib.loadJs('FDButton',function() {
	var permissionData = {'1':['view']}
	FDRight.setData(permissionData);
	
	
	btn1 = new FDButton({domId:'btn1',text:'按钮文本',onclick:function(){
		alert(1)
	}});
	
	new FDButton({
		domId:'btn2',
		text:'左边'
		,iconConfig:{showIcon:true,iconClass:'ui-icon-check'}	
	});
	new FDButton({
		domId:'btn3',
		text:'右边'
		,iconConfig:{showIcon:true,iconClass:'ui-icon-check',rightIcon:true}	
	});
	new FDButton({
		domId:'btn4',
		text:'只有图标'
		,iconConfig:{showIcon:true,iconClass:'ui-icon-disk',iconOnly:true}	
	});
	new FDButton({
		domId:'btn5',
		text:'权限按钮'
		,operateCode:'view' // 将view改成其它值将不显示
	});
	
});

function setOnclickEvent() {
	btn1.setOnclick(function(){
		alert(2);
	})
}
function setText() {
	btn1.setText('按钮aaa')
}
function disable() {
	btn1.disable();
}
function enable() {
	btn1.enable();
}
function show() {
	btn1.show();
}
function hide() {
	btn1.hide();
}
</script>
</body>
</html>